import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;


public class Logi {
	static String asukoht="";
	static String nimi="log.txt";
	FileWriter fw;
	BufferedWriter bw;
	Logi(){
		teeLogija();
	}
	Logi(String t,String n){
		asukoht=t;
		nimi=n;
		teeLogija();
	}
	
	void teeLogija(){
		try {
			fw=new FileWriter(asukoht+nimi);
			bw=new BufferedWriter(fw);
			bw.write(String.valueOf(System.currentTimeMillis()));
			bw.newLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void kirjuta(String s){
		try {
			bw.write(s);
			bw.newLine();
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public void sulge(){
		try {
			bw.flush();
			bw.close();
			fw.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
